home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 12.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-09-10  |  5.8 KB  |  245 lines

  1. /*
  2.                                  Visual FX
  3.                                     For
  4.                                  Image FX
  5.                                SetUp Script
  6.                            Written By J.L. White
  7.  
  8.                          (C)1997 Merlin's Software
  9.  
  10. */
  11. parse arg Num Frames
  12. options results
  13. address "IMAGEFX.1"
  14. Quotes = '22'X
  15.     RequestResponse "Do You Need Instructions?"
  16.     if rc = 0 then do
  17.         call Docs()
  18.         end    
  19.  
  20.  
  21. if exists("libs:flyer.library") then do
  22.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  23.         RequestNotify 'Flyer Must Be Running First!'
  24.         exit
  25.         end
  26.     call OpenFlyStuff()
  27.  
  28.  
  29.     Gadget.1 = 'D/110/22/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  30.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  31.     if rc ~= 0 then do
  32.         call CloseStuff()
  33.         exit 0
  34.         end
  35.     else do
  36.         IAType = RESULT.1
  37.            end
  38.  
  39.     call GetA()
  40. end
  41. else do
  42.     Gadget.1 = 'D/110/22/120/ImageA Type/2/FRAME/SEQUENCE'
  43.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  44.     if rc ~= 0 then do
  45.         call CloseStuff()
  46.         exit 0
  47.         end
  48.     else do
  49.         IAType = RESULT.1+2
  50.            end
  51.  
  52.     call GetA()
  53. end
  54.  
  55. if FlyOn = 1 then
  56.     call CloseStuff()
  57.  
  58.  
  59.     ReDraw On
  60.     LoadBuffer "VFXIFX:Images/Pics/Textures.Pic" Force
  61.     RequestNotify "Look At Examples For FileName Then Click "Quotes"Okay"Quotes""
  62.     RequestFile '"Select File To Use For Background!" "VFXIFX:Images/Textures" ""'
  63.     BrushName = result
  64.     ActiveColor 2
  65.     RequestNotify "Click On Color To Use For Highlights Then Click "Quotes"Okay"Quotes""
  66.     ActiveColor
  67.     Color = result
  68.     ActiveColor 1
  69.     text1 = '"Move X"'
  70.     text2 = '"Move Y"'
  71.     Gadget.1  = 'SLIDER LE=60 TE=4 WD=150 HT=14 LB='text1' IN=1 LO=-10 HI=10 LV=%-3ld'
  72.     Gadget.2  = 'SLIDER LE=60 TE=22 WD=150 HT=14 LB='text2' IN=1 LO=-10 HI=10 LV=%-3ld'
  73.     Gadget.3 = 'END'
  74.     NewComplexRequest  '"Select X & Y Movements!"' Gadget 250 42
  75.     if rc ~= 0 then do
  76.         XOff = 0
  77.         YOff = 0
  78.         end
  79.     else do
  80.         XOff = RESULT.1
  81.         YOff = RESULT.2
  82.         end
  83.  
  84.     RequestSlider '"Enter Percentage To Blend Texture!"' 1 100 50
  85.     BlendAnswer = Result
  86.  
  87.  
  88. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  89. call writeln TempFile,PicAName
  90. call writeln TempFile,Start
  91. call writeln TempFile,End
  92. call writeln TempFile,IAType
  93. call writeln TempFile,Color
  94. call writeln TempFile,XOff
  95. call writeln TempFile,YOff
  96. call writeln TempFile,BrushName
  97. call writeln TempFile,BlendAnswer
  98. call close TempFile
  99. exit
  100.  
  101.  
  102. GetFile:
  103.     parse Arg Title, Path
  104.     Address FLY_1 SetString Path
  105.     Address FLY_1 GetFileNameNT Title
  106. return result
  107.  
  108. GetFileName: procedure  
  109.    ARG CompleteName
  110.    c = lastpos("/",CompleteName)
  111.    if c = 0 then c = lastpos(":",CompleteName)
  112.    return substr(CompleteName, c + 1)
  113.  
  114.  
  115. GetA:
  116.  if IAType = 0 then do
  117.     call Switcher(TOSW)
  118.     PicAName = GetFile("Select Flyer Clip For ImageA!  ",DriveName)
  119.     Name = GetFileName(PicAName)
  120.     if Name = "" then do
  121.         Address FLY_1 OK_TEXT " OK "
  122.         Title = "You Must Enter A Valid Clip Name To Use!"
  123.         Address FLY_1 FYINT Title
  124.         Address FLY_1 Quit
  125.         call Switcher(TOWB)
  126.         exit
  127.         end
  128.     Address FLY_1 SetFileName PicAName
  129.     Address FLY_1 GetClipLength PicAName
  130.     End = result
  131.     Start = 0
  132.     Address FLY_1 Program "5"
  133.     Address FLY_1 StartNum Start
  134.     Address FLY_1 EndNum End
  135.     Address FLY_1 CurrentNum "0"
  136.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  137.     Start = word(result,1)*2
  138.     End = word(result,2)*2
  139.     Start  = Start + 1
  140.     End = End +2
  141.     call addlib('PROJECT_REXX_PORT' , 0)
  142.     call addlib(TOASTERLIB,0)
  143.     call Switcher(TOWB)
  144.     address command "C:Wait 1"
  145.     ScreenToFront
  146.     end
  147.    if IAType = 1 then do
  148.     RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
  149.     PicAName = result
  150.     Name = GetFileName(PicAName)
  151.     if Name = "" then do
  152.         Title = "You Must Enter A Valid Name To Use!"
  153.         RequestNotify Title
  154.         if FlyOn = 1 then Address FLY_1 Quit
  155.         exit
  156.         end
  157.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  158.     End = result
  159.     Start = 1
  160.     end
  161.    if IAType = 2 then do
  162.     RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
  163.     PicAName = result
  164.     Name = GetFileName(PicAName)
  165.     if Name = "" then do
  166.         Title = "You Must Enter A Valid Name To Use!"
  167.         RequestNotify Title
  168.         if FlyOn = 1 then Address FLY_1 Quit
  169.         exit
  170.         end
  171.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  172.     End = result
  173.     Start = 1
  174.     end
  175.    if IAType = 3 then do
  176.     RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
  177.     PicAName = result
  178.     Name = GetFileName(PicAName)
  179.     if Name = "" then do
  180.         Title = "You Must Enter A Valid Name To Use!"
  181.         RequestNotify Title
  182.         if FlyOn = 1 then Address FLY_1 Quit
  183.         exit
  184.         end
  185.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  186.     End = result
  187.     Start = 1
  188.     end
  189. return
  190.  
  191. CloseStuff:
  192.     Address FLY_1 Quit
  193.     call remlib('ToasterARexx.port')
  194.     call remlib('PROJECT_REXX_PORT')
  195. return
  196.  
  197.  
  198. OpenFlyStuff:
  199.     FlyOn = 1
  200.     address command "run VFXIFX:FLY" 
  201.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  202.         address command "wait 1"
  203.         end
  204.     TOASTERLIB="ToasterARexx.port"
  205.     call remlib('ToasterARexx.port')
  206.     call remlib('PROJECT_REXX_PORT')
  207.     call addlib('PROJECT_REXX_PORT' , 0)
  208.     call addlib(TOASTERLIB,0)
  209.     DriveName = FindDrive()
  210. return
  211.  
  212.  
  213. FindDrive:
  214.     address command "C:Info >RAM:DriveList"
  215.     call open TempFile,"RAM:DriveList",R
  216.     do until eof(TempFile)
  217.         line = readln(TempFile)
  218.         parse var line Drive" "Rest
  219.         if Drive = "FA0:" then 
  220.             FlyVolume = word(Rest,7)":"
  221.     end
  222.     call close TempFile
  223.     address command "Delete >NIL: RAM:DriveList"
  224. return FlyVolume
  225.  
  226.  
  227.  
  228. Docs:
  229.  
  230.     text1 = '"This effect takes an image and composites it with "'
  231.     text2 = '"a scrolling texture background. You can select any"'
  232.     text3 = '"seamless image for the texture and choose what color"'
  233.     text4 = '"to highlight it with. You can also determine what"'
  234.     text5 = '"percentage to blend it with the main image."'
  235.  
  236.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  237.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  238.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  239.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  240.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  241.     Gadget.6 = 'END'
  242.     NewComplexRequest  '"Instructions For Effect #12"' Gadget 380 56
  243.  
  244. return
  245.